package com.cjb.cloudsystem.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjb.cloudsecurity.userMsg.entity.UserDetail;
import com.cjb.cloudsystem.entity.SysUser;
import com.cjb.cloudsystem.vo.EditPassword;
import com.cjb.cloudsystem.vo.FileVO;
import com.cjb.cloudsystem.vo.SysUserVO;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
* 用户管理
*
* @author 陈锦斌 2213859123@qq.com
* @since 1.0.0 2023-09-23
*/
public interface SysUserService extends com.baomidou.mybatisplus.extension.service.IService<SysUser> {
    /**
    * 单体保存
    * @Author chenjinbin
    * @Value
    * @Title
    */
    boolean save(SysUser sysUser);

    /**
    *批量保存
    *
    * @Author chenjinbin
    * @Value
    * @Title
    */
    Integer listSave(List<SysUser> sysUser);
    /**
    * 批量更新
    *
    * @Author chenjinbin
    * @Value
    * @Title
    */
    void listUpdate(List<SysUser> sysUser);
    /**
    * 批量删除
    *
    * @Author chenjinbin
    * @Value
    * @Title
    */
    void listDelete(List<SysUser> sysUser);


    /**
    * 通过id删除
    *
    * @Author chenjinbin
    * @Value
    * @Title
    */
    int deleteById(SysUser sysUser);
    /**
    *单个查询
    *
    * @Author chenjinbin
    * @Value
    * @Title
    */
    SysUser queryById(Long id);
    /**
    * 分页查询
    *
    * @Author chenjinbin
    * @Value
    * @Title
    */
    Page<SysUser> queryPage(Page sysUserPage , SysUserVO sysUser);

    /**
    * 返回全部信息
    *
    * @Author chenjinbin
    * @Value
    * @Title
    */
    List<SysUser> returnAllData();

    /**
     *获取用户信息
     *
     * @Author chenjinbin
     * @Value
     * @Title
     */
    UserDetail getUser();
    /**
     * 密码修改
     *
     * @Author chenjinbin
     * @Value
     * @Title
     */
    UserDetail editPassword(EditPassword editPassword);

    /**
     * 更换头像
     *
     * @Author chenjinbin
     * @Value
     * @Title
     */
    FileVO upload(MultipartFile file, String dir,Long userId) ;

    /**
     * 用户数量查询
     *
     * @Author chenjinbin
     * @Value
     * @Title
     */
    Long countUserByNameAndPassword(String userName,String password);

    /**
     * 数据导出
     *
     * @Author chenjinbin
     * @Value
     * @Title
     */
    List<SysUser> queryList(SysUserVO sysUser);
}
